<?php
/**
 * 描述
 * Created by Paco
 * Date: 2019/1/29 Time: 11:31
 */

namespace App\Http\Controllers\Admin\Shop;


use App\Http\Controllers\Controller;
use App\Http\Request\Shop\ShopStore;
use App\Repositories\Shop\AdminShopRepository;
use Illuminate\Http\Request;

class ShopController extends Controller
{
    private $shop;

    public function __construct(AdminShopRepository $shop)
    {
        $this->shop = $shop;
    }


    public function index(Request $request)
    {
        return $this->shop->index($request->all());
    }

    public function shop(Request $request)
    {
        return $this->shop->shop($request->all());
    }
    /**
     *
     * update
     * author Paco
     * createTime 2019/1/29 15:50
     * @param ShopStore $shop
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Validation\ValidationException
     */
    public function update(ShopStore $shop,Request $request)
    {
        $params = $shop->validated($request);
        return $this->shop->update($params);
    }
}